﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VConfigs.Entity;
using VCommons;
using System.Configuration;

namespace VConfigs
{
    /// <summary>
    /// 网站常量配置信息
    /// </summary>
    public class WebInfoConfig : ConfigBase
    {
        /// <summary>
        /// 得到配置文件信息方法  返回 ROYcms.Sys.Model.ROYcmsConfig 
        /// </summary>
        /// <returns></returns>
        public static WebInfo Get_Config()
        {
            WebInfo webInfo = new WebInfo();
            //缓存处理
            if (DataCache.GetCache("WebInfoConfig") == null)
            {
                webInfo.WebDoMain = GetAppSetting("WebDoMain").ToString();
                webInfo.WebVerson = GetAppSetting("WebVerson").ToString();
                webInfo.WebPasswordKey = GetAppSetting("WebPasswordKey").ToString();
                webInfo.DevsSqlConn = GetAppSetting("Development").ToString();
                webInfo.ReleaseSqlConn = GetAppSetting("Release").ToString();
                webInfo.DataProvider = GetAppSetting("DataProvider").ToString();
                DataCache.SetCache("WebInfoConfig", (object)webInfo);
            }
            else
            {
                webInfo = (WebInfo)DataCache.GetCache("WebInfoConfig");
            }

            return webInfo;
        }

    }
}
